<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:zj="http://www.zju.edu.cn" exclude-result-prefixes="zj">
  <xsl:import href="Button_Trans.xslt"/> 
  <xsl:template name="zj:HRefButton">
    <xsl:param name="Name"/>
    <xsl:param name="HRef"/>
    <xsl:param name="OnClick"/>
    <img src="../images/empty.gif" width="5" height="1"/>   
    <a href="{$HRef}"  class="l-btn" title="{$Name}">
      <xsl:attribute name="onclick">
        <xsl:choose>
          <xsl:when test="$OnClick = ''">disableButtonById(0); return true;</xsl:when>
          <xsl:otherwise>
            <xsl:value-of select="$OnClick"/>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:attribute>
      <span class="l-btn-left">
        <span class="l-btn-text">
          <xsl:value-of select="$Name"/>
        </span>
      </span>
    </a>    
  </xsl:template>
  <xsl:template name="zj:HRefClickButton">
    <xsl:param name="Name"/>
    <xsl:param name="HRef"/>
    <xsl:param name="OnClick"/>
    <xsl:param name="Target"/>
    <img src="../images/empty.gif" width="5" height="1"/>   
    <a href="{$HRef}" class="l-btn" title="{$Name}" onclick="return {$OnClick}">
      <xsl:if test="$Target != ''">
        <xsl:attribute name="target">
          <xsl:value-of select="$Target"/>
        </xsl:attribute>
      </xsl:if>
      <span class="l-btn-left">
        <span class="l-btn-text">
          <xsl:value-of select="$Name"/>
        </span>
      </span>
    </a>
  </xsl:template>
  <xsl:template name="zj:JSButton">
    <xsl:param name="Name"/>
    <xsl:param name="JS"/>
    <img src="../images/empty.gif" width="5" height="1"/>    
    <a href="#" class="l-btn" title="{$Name}" onclick="javascript:{$JS};">     
      <span class="l-btn-left">
        <span class="l-btn-text">
          <xsl:value-of select="$Name"/>
        </span>
      </span>
    </a>    
  </xsl:template>
  <xsl:template name="zj:JSClickButton">
    <xsl:param name="Name"/>
    <xsl:param name="JS"/>
    <img src="../images/empty.gif" width="5" height="1"/>   
    <a href="#" class="l-btn" title="{$Name}" onclick="javascript:disableButtonById(0);if (!{$JS}) enableButtonById(0);return true;">
      <span class="l-btn-left">
        <span class="l-btn-text">
          <xsl:value-of select="$Name"/>
        </span>
      </span>
    </a>
  </xsl:template>
</xsl:stylesheet>
